package com.tudou.searchcontrol.web;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.ModelAttribute;


public class BaseAction {

	private String context = null;

	@Autowired
	private HttpServletRequest request;
	
	@ModelAttribute("context")
	public String getContext() {
		if (context == null) {
			context = request.getContextPath();
		}
		return context;
	}
}
